package com.hry.myapp.beans;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class WXServiceInfo {
	
	@Value("${server.port}")
	private String port ;
	
	@Value("${server.protocol}")
	private String protocol ;
	
	@Value("${server.address}")
	private String address ;
	
	@Value("${server.avatar_url_path}")
	private String avatarUrltPath ;
	
	@Value("${server.avatar_dest_path}")
	private String avatarDestPath ;
	

	
	

	public String getAvatarDestPath() {
		return avatarDestPath;
	}

	public void setAvatarDestPath(String avatarDestPath) {
		this.avatarDestPath = avatarDestPath;
	}

	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	public String getProtocol() {
		return protocol;
	}

	public void setProtocol(String protocol) {
		this.protocol = protocol;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	

	public String getAvatarUrltPath() {
		return avatarUrltPath;
	}

	public void setAvatarUrltPath(String avatarUrltPath) {
		this.avatarUrltPath = avatarUrltPath;
	}

//		基本url e.g. http://127.0.0.1:8099
	public String getBaseUrl() {
		
		String baseUrl = this.protocol+"://"+this.address+":"+this.port ;
		
		return baseUrl ;
		
	}
	
//	本地存储微信用户头像的目录
	public String getAvatarCompleteDestPath() {
		
		return this.getAvatarDestPath()+this.getAvatarUrltPath() + "/";
		
	}
	
//	前端用于访问的用户头像的完整url
	public String getAvatarCompleteUrlPath() {
		
		return this.getBaseUrl()+this.getAvatarUrltPath() + "/";
	}

	
	
	
	
	

}
